All Questions
6 questions
2votes
3answers
1kviews
Find the 'n' most frequent words in a text, aka word frequency
I'm doing freeCodeCamp's Coding Interview Prep to improve my JavaScript skills. This challenge is called "Word Frequency", and is based on the Rosetta Code's entry of the same name. The ...
2votes
0answers
628views
Cron expression parser
Problem Write a command line application or script which parses a cron string and expands each field to show the times at which it will run. ~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find"...
3votes
1answer
580views
Find the largest product of an array
This task is taken from www.interviewbit.com Given an array of integers, return the highest product possible by multiplying 3 numbers from the array Input: ...
5votes
3answers
1kviews
Print out N by N Spiral Matrix in javascript
I got this question during my practice interview. Matrices - N Spiral Matrix Prompt Given an integer N, output an N x N spiral matrix with integers 1 through N. Examples: ...
1vote
1answer
915views
Hackerrank "Queues: A Tale of Two Stacks" Javascript Solution
Here is the original problem, and below is my solution (passing). It's asking to implement a queue with 2 stacks, which means I cannot simply use Array.shift. I wonder if the solution can be improved. ...
18votes
4answers
2kviews
O(N) vs O(N * N) for Word Frequency Algorithm
I am trying to come up with a better solution to the following problem: Statement You are supposed to write a function which takes the contents of a document in string format and also a whole ...